package basic;

public class Student_p extends Person{
    private String Sno;// Student ID
    private int JAVA_Grade; //Java
    private int DB_Grade; //DataBase
    private int DS_Grade; //DataStructure

    public Student_p(String name, char sex, int age, String sno, int JAVA_Grade, int DB_Grade, int DS_Grade) {
        super(name, sex, age);
        Sno = sno;
        this.JAVA_Grade = JAVA_Grade;
        this.DB_Grade = DB_Grade;
        this.DS_Grade = DS_Grade;
    }

    public Student_p(String name, String sno, int JAVA_Grade, int DB_Grade, int DS_Grade) {
        super(name);
        Sno = sno;
        this.JAVA_Grade = JAVA_Grade;
        this.DB_Grade = DB_Grade;
        this.DS_Grade = DS_Grade;
    }

    public Student_p(String name, char sex, String sno, int JAVA_Grade, int DB_Grade, int DS_Grade) {
        super(name, sex);
        Sno = sno;
        this.JAVA_Grade = JAVA_Grade;
        this.DB_Grade = DB_Grade;
        this.DS_Grade = DS_Grade;
    }

    public Student_p(String name, int age, String sno, int JAVA_Grade, int DB_Grade, int DS_Grade) {
        super(name, age);
        Sno = sno;
        this.JAVA_Grade = JAVA_Grade;
        this.DB_Grade = DB_Grade;
        this.DS_Grade = DS_Grade;
    }

    public Student_p(String name, char sex, int age) {
        super(name, sex, age);
    }

    public Student_p(String name) {
        super(name);
    }

    public Student_p(String name, char sex) {
        super(name, sex);
    }

    public Student_p(String name, int age) {
        super(name, age);
    }

    @Override
    public String toString() {
        return "Student_p{" +
                "Sno='" + Sno + '\'' +
                ", JAVA_Grade=" + JAVA_Grade +
                ", DB_Grade=" + DB_Grade +
                ", DS_Grade=" + DS_Grade +
                '}';
    }

    //averageGrade
    public double aver(){
        return (double)(JAVA_Grade+DB_Grade+DS_Grade)/3;
    }

    //getMax
    public int max(){
        return JAVA_Grade>Math.max(DB_Grade,DS_Grade)?JAVA_Grade:Math.max(DB_Grade,DS_Grade);
    }

    //getMin
    public int min(){
        return JAVA_Grade>Math.min(DB_Grade,DS_Grade)?Math.min(DB_Grade,DS_Grade):JAVA_Grade;
    }

    public static void main(String[] args) {
        Student_p s=new Student_p("nike",'M',19,"201908992",89,89,90);
        System.out.println(s.toString());
    }
}
